<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
</head>
<body>
    <script src="js/jquery-3.4.1.min.js"></script>

    <button id="btn1">点我试试</button> 
    <hr> 
    <img src="img/1.jpg" title="美女大图" width="300">

    <script>
       /* attr( "属性" ); 获得元素的属性值
            attr( "属性" , "新值" ); 修改元素的属性值
            attr( 样式参数 ) ：样式参数可以写成json格式 */
        $("#btn1").click(function(){
            $("img").attr("src","img/2.jpg");
            $("img").attr("title","高清无码");
            $("img").attr( {width:"200",height:"200"} );

        });
 
    </script>
</body>
</html>